  <!-- Change Password-->
<h3 class="sprited" >Change your password</h3>
<div style="text-align: center; padding:15px 0px;"><img src="/images/site/changePwd.jpg" alt="" /></div>
	<div class="grid_10 column alpha">		
		<div>
		<label>Old Password</label>
		</div>
		<input type="password" name="oldpwd" id="oldpwd" class="contact-box"/>
		<br><br>
		
		<div>
		<label>New Password</label>
		</div>
		<input type="password" name="newpwd" id="newpwd" class="contact-box"/>
		<br><br>
		
		<div>
		<label>Confirm Password</label>
		</div>
		<input type="password" name="confirm-pwd" id="confirm-pwd" class="contact-box"/><br><br>
		
		<div>
			<input type="button" onclick="changePassword()" value="Save" id="set-password" class="btn btn-green"/><span id="confirmerrormsg" style="margin-left:70px;color:green"><span>
		</div>
		<div class="clear"></div>
	</div>
	<a id="close_x" class="close sprited" href="#">close</a> 

<!--End-->
<script>
	function changePassword(){	
		var flag=true;
		var userId='<?echo $_GET['id'];?>';
		var oldpasswrd=$("#oldpwd").val();		
		var passwrd=$("#newpwd").val();
		var cnfpwrd=$("#confirm-pwd").val();		
		if(passwrd==""&& cnfpwrd==""){
			$("#confirmerrormsg").html('Please Enter Your New Password!');
			flag=false;
			$("#newpwd").focus();
		}
		if(oldpasswrd==""){
			$("#confirmerrormsg").html('Please Enter Your Old Password!');
			flag=false;
			$("#oldpwd").focus();
		}	
		if(flag==false){ 
				return false;
		}else{			
			if(passwrd==cnfpwrd){
				$.ajax({
					type:'POST',
					url:   '/user/check-password',
					data:{oldpasswrd:oldpasswrd,userId:userId},
					success: function(data){
						if(data.output=='success'){	
							$.ajax({
								type:'POST',
								url:   '/user/change-password',
								data:{cnfpwrd:cnfpwrd,userId:userId},
								success: function(data){
									$("#confirmerrormsg").html('Your Password Successfully Updated!');
								}
							});					
						}else{
							$("#confirmerrormsg").html('You Entered Old Password Is Wrong');
						}
					}
				});					
			}else{
				$("#confirmerrormsg").html('Your Confirm Password do not match!');
				$("#confirm-pwd").focus();
			}
		}		
	}	
</script>